package com.medata.service.impl;

import com.medata.dataObject.Fj;
import com.medata.repository.FjRepository;
import com.medata.service.FjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

/**
 * @author ：zb
 * @date ：Created in 2019/6/28 0028 10:12
 * @description：
 */
@Service
public class FjServiceImpl implements FjService {
    @Autowired
    private FjRepository fjRepository;

    @Override
    public List<Fj> findByEducationOrComputerOrEmployOrFxyOrProfession(Integer num1, Integer num2, Integer num3, Integer num4, Integer num5) {
        return fjRepository.findByEducationOrComputerOrEmployOrFxyOrProfession(num1,num2,num3,num4,num5);
    }

    @Override
    @Transactional
    public void saveOrUpdate(Fj fj) {
        fjRepository.save(fj);
    }

    @Override
    public Integer unfullCount(Integer num1, Integer num2, Integer num3, Integer num4, Integer num5) {
        return fjRepository.unfullCount(num1,num2,num3,num4,num5);
    }

    @Override
    public Page<Fj> getByEducation(Integer number, Pageable pageable) {
        return fjRepository.getByEducation(number,pageable);
    }

    @Override
    public Page<Fj> getByEmploy(Integer number, Pageable pageable) {
        return fjRepository.getByEmploy(number,pageable);
    }

    @Override
    public Page<Fj> getByFxy(Integer number, Pageable pageable) {
        return fjRepository.getByFxy(number,pageable);
    }

    @Override
    public Page<Fj> getByComputer(Integer number, Pageable pageable) {
        return fjRepository.getByComputer(number,pageable);

    }

    @Override
    public Page<Fj> getByProfession(Integer number, Pageable pageable) {
        return fjRepository.getByProfession(number,pageable);

    }

    @Override
    public int countByEducation(Integer number) {
        return fjRepository.countByEducation(number);
    }

    @Override
    public int countByEmploy(Integer number) {
        return fjRepository.countByEmploy(number);
    }

    @Override
    public int countByFxy(Integer number) {
        return fjRepository.countByFxy(number);
    }

    @Override
    public int countByComputer(Integer number) {
        return fjRepository.countByComputer(number);
    }

    @Override
    public int countByProfession(Integer number) {
        return fjRepository.countByProfession(number);
    }

    @Override
    public Fj getByDocid(Integer docid) {
        return fjRepository.getByDocid(docid);
    }

    @Override
    @Transactional
    public void deleteByTitle(String title) {
        fjRepository.deleteByTitle(title);
    }
}

